﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Web;
using System.Web.DomainServices;

namespace ExpenseReport
{
    /// <summary>
    /// ExpeneseReport partial class used to associate the class with a metadata class.
    /// </summary>
    [MetadataType(typeof(ExpenseReportMetadata))]
    public partial class ExpenseReport 
    {
    }

    /// <summary>
    /// Metadata class for ExpenseReport used to apply metadata to ExpenseReport properties.
    /// </summary>
    public partial class ExpenseReportMetadata
    {
        [Bindable(true, BindingDirection.TwoWay)]
        [StringLength(10)]
        [Display(Name = "Company", Description = "Company where you work.")]
        public static object Company;

        [Bindable(true, BindingDirection.TwoWay)]
        [Display(Name = "Created Date", Description = "Date of the expense report.")]
        public static object Created;

        [Bindable(true, BindingDirection.TwoWay)]
        [StringLength(10)]
        [Display(Name = "Department", Description = "Department where you work")]
        public static object Department;

        [Bindable(true, BindingDirection.TwoWay)]
        [Display(Name = "Description", Description = "Description of the reason for the expenses.")]
        public static object Description;

        [Include]
        [Display(Name = "Details", Description = "Expense Report Line Items.")]
        public static object ExpenseReportDetails;

        [Include]
        public static object Employee;

        [Bindable(false)]
        public static object id;

        [Bindable(true, BindingDirection.TwoWay)]
        [Display(Name = "Status", Description = "The status of the expense report.")]
        public static object Status;
    }

    /// <summary>
    /// ExpenseReportDetails partial class used to associate the class with a metadata class.
    /// </summary>
    [MetadataType(typeof(ExpenseReportDetailsMetadata))]
    [CustomValidation(typeof(ExpenseReportValidation),"ValidateDescription")]
    public partial class ExpenseReportDetails { }

    /// <summary>
    /// Metadata class for ExpenseReportDetails used to apply metadata to ExpenseReportDetails properties.
    /// </summary>
    public partial class ExpenseReportDetailsMetadata
    {
        [Bindable(true, BindingDirection.TwoWay)]
        [Required]
        [Display(Name = "Expense Amount", Description = "The amount of the incurred expense.")]
        [Range(0.0, 1000000.00)]
        public static object Amount;

        [Bindable(true, BindingDirection.TwoWay)]
        [Display(Name = "Category", Description = "The category of expense, i.e., mileage.")]
        [StringLength(10)]
        public static object Category;

        [Bindable(true, BindingDirection.TwoWay)]
        [Display(Name = "City", Description = "The city where the expense was incurred.")]
        [StringLength(50)]
        public static object City;

        [Bindable(true, BindingDirection.TwoWay)]
        [Display(Name = "Expensed on Credit Card", Description = "Was a credit card used to pay this expense.")]
        public static object CreditCardExpense;

        [Bindable(true, BindingDirection.TwoWay)]
        [CustomValidation(typeof(ExpenseReportValidation),"ValidateDateIncurred")]
        [Display(Name = "Date", Description = "The date of when this expense was incurred.")]
        [Required]
        public static object DateIncurred;

        [Bindable(false)]
        public static object ExpenseReport;

        [Bindable(false)]
        public static object id;

        [Bindable(false)]
        [Display(Name = "Line Item", Description = "The line number of the expense.")]
        public static object LineItem;

        [Bindable(true, BindingDirection.TwoWay)]
        [Display(Name = "Detailed Description", Description = "A detailed description for the expense.")]
        [StringLength(500)]
        public static object LongDescription;

        [Bindable(true, BindingDirection.TwoWay)]
        [Display(Name = "Summary", Description = "A short description for the expense.")]
        [StringLength(50)]
        [Required]
        public static object ShortDescription;

        [Bindable(true, BindingDirection.TwoWay)]
        [Display(Name = "State", Description = "The state where the expense was incurred.")]
        [StringLength(2)]
        public static object State;
    }

    /// <summary>
    /// Employee partial class used to associate the class with a metadata class.
    /// </summary>
    [MetadataType(typeof(EmployeeMetadata))]
    public partial class Employee { }

    /// <summary>
    /// Metadata class for Employee used to apply metadata to Employee properties.
    /// </summary>
    public partial class EmployeeMetadata
    {
        [Bindable(true, BindingDirection.TwoWay)]
        [Display(Name = "Login ID of employee", Description = "Login ID of employee.")]
        public static object employee;

        [Bindable(true, BindingDirection.TwoWay)]
        [Display(Name = "Login ID of manager", Description = "Login ID of employee's manager.")]
        public static object manager;

        [Bindable(true, BindingDirection.TwoWay)]
        [Display(Name = "Name", Description = "The name of employee.")]
        public static object Name;
    }

}